
#ifndef __MEASUREMENT_H__
#define __MEASUREMENT_H__

#include "Unit.h"
#include <ostream>

const int EXCEPTION_UNIT_TYPE_NOT_MATCH(1);

class Measurement
{
public:
    explicit Measurement(unsigned int amount, const Unit &unit);

    bool operator==(const Measurement &measurement) const  throw(int);
    bool operator!=(const Measurement &measurement) const  throw(int);

    Measurement operator+(const Measurement &measurement) const throw(int);
	string formatToString() const;
    string formatToStringInBaseUnit() const;

private:
    unsigned int getAmountInBaseUnit() const;

    unsigned int    amount;
    const Unit      &unit;
};

#endif

